$(function()
{
    $(document).scroll(function()
    {
        var scrolltop = $(document).scrollTop();  
        if(parseInt(scrolltop) >= 200 && $(document).width() >= 770)         
        { 
            $("#menu").css({"position":"fixed","top":"0"});       
        }
        else
        {
            $("#menu").css({"position":"relative","top":"0px"});
        }
    });
	   
    $(document).scroll();
});